#ifndef DBSTORAGE_REQMOVE_ROOT_REQUIREMENT_STORAGE_CMD_HPP
#define DBSTORAGE_REQMOVE_ROOT_REQUIREMENT_STORAGE_CMD_HPP

#include "DbStorage/DbStorageCmd.hpp"

namespace Model { class Requirement; class Package; }

namespace DbStorage
{

/// @ingroup DbStorage
/// @brief It implements the storage command for removing a root requirement.
class DBSTORAGE_API RemoveRootRequirementStorageCmd: public DbStorageCmd
{
public:
	/// @brief It initializes the command.
	/// @param subject the requirement to be removed from storage.
	/// @param dbConnection the database connection to be used for storage.
	/// @param pParentPackage the parent package of the remvoed requirement.
	/// @pre The requirement to be removed from the storage should be a root requirement.
	RemoveRootRequirementStorageCmd( Model::Requirement& subject, Model::Package* pParentPackage, CaseDB::Connection& dbConnection);
	
	/// @brief It inserts the root requirement from the database, together with all child requirements.
	///
	/// The insertion generates a primary key which will be set to the stored requirement object as the stored 
	///	identifier.
	virtual void execute();

private:
	Model::Package* pParentPackage_;
};


} // namespace DbStorage

#endif // DBSTORAGE_REQMOVE_ROOT_REQUIREMENT_STORAGE_CMD_HPP